/// 🎯 活动编辑请求模型
/// 
/// 用于封装发送给后端的活动编辑请求参数
/// 对应接口: POST /activities/edit
class ActivityEditReq {
  final int activityId;
  final String? activityTitle;
  final String? activityDetails;
  final String? activityLocation;
  final List<String>? activityImages;
  final List<String>? activityType;
  final List<String>? activityTags;
  final int? activityMaxParticipants;
  final String? activityPublishTime;
  final double? latitude;
  final double? longitude;
  final String? activityStatusMessage;
  final Map<String, dynamic>? extraData;

  ActivityEditReq({
    required this.activityId,
    this.activityTitle,
    this.activityDetails,
    this.activityLocation,
    this.activityImages,
    this.activityType,
    this.activityTags,
    this.activityMaxParticipants,
    this.activityPublishTime,
    this.latitude,
    this.longitude,
    this.activityStatusMessage,
    this.extraData,
  });

  /// 转换为JSON（发送给后端）
  Map<String, dynamic> toJson() {
    final json = <String, dynamic>{
      'activityId': activityId,
    };

    if (activityTitle != null) json['activityTitle'] = activityTitle;
    if (activityDetails != null) json['activityDetails'] = activityDetails;
    if (activityLocation != null) json['activityLocation'] = activityLocation;
    if (activityImages != null) json['activityImages'] = activityImages;
    if (activityType != null) json['activityType'] = activityType;
    if (activityTags != null) json['activityTags'] = activityTags;
    if (activityMaxParticipants != null) json['activityMaxParticipants'] = activityMaxParticipants;
    if (activityPublishTime != null) json['activityPublishTime'] = activityPublishTime;
    if (latitude != null) json['latitude'] = latitude;
    if (longitude != null) json['longitude'] = longitude;
    if (activityStatusMessage != null) json['activityStatusMessage'] = activityStatusMessage;
    if (extraData != null) json['extraData'] = extraData;

    return json;
  }
}

